<template>
  <div>
    <!-- <some-dog :list="list" @name='name'></some-dog> -->
    <some-dog
      v-for="(item, index) in list"
      :key="index"
      :dogImgUrl="item.dogImgUrl"
      :dogName="item.dogName"
      @name="fn"
    ></some-dog>
    <buy-table></buy-table>
    <hr />
    <p>喜欢狗狗的名称:</p>
    <ul>
      <li v-for="(item, index) in dogsName" :key="index">{{ item }}</li>
    </ul>
    <!-- <table>
      <tr
        is="BuyTable"
        v-for="(item, index) in goodsArr"
        :key="index"
        :item="item"
        :index="index"
      ></tr>
    </table>
    <p>All Number:{{ sumNumber }}</p> -->
  </div>
</template>
<script>
/* import BuyTable from "./components/BuyTable.vue"; */
import SomeDog from "./components/SomeDog.vue";
export default {
  components: {
    SomeDog,
   /*  BuyTable, */
  },
  data() {
    return {
      list: [
        {
          dogImgUrl:
            "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fci.xiaohongshu.com%2Fff12dd14-290c-afca-3899-e47b2f914276%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fci.xiaohongshu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1685530877&t=625d78e47aef395e38b620b5826a9f62",
          dogName: "博美",
        },
        {
          dogImgUrl:
            "https://img0.baidu.com/it/u=2086612941,3688431407&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=752",
          dogName: "泰迪",
        },
        {
          dogImgUrl:
            "https://img1.baidu.com/it/u=976666370,1547781593&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=1066",
          dogName: "金毛",
        },
        {
          dogImgUrl:
            "https://img1.baidu.com/it/u=406039031,2586444384&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889",
          dogName: "哈士奇",
        },
        {
          dogImgUrl:
            "https://img2.baidu.com/it/u=4288915134,117863428&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=728",
          dogName: "阿拉斯加",
        },
        {
          dogImgUrl:
            "https://img0.baidu.com/it/u=3347755687,1803258680&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=749",
          dogName: "萨摩耶",
        },
      ],
      dogsName: [],
      /* goodsArr: [
        {
          count: 0,
          goodsName: "Watermelon",
        },
        {
          count: 0,
          goodsName: "Banana",
        },
        {
          count: 0,
          goodsName: "Orange",
        },
        {
          count: 0,
          goodsName: "Pineapple",
        },
        {
          count: 0,
          goodsName: "Strawberry",
        },
      ], */
    };
  },
  methods: {
    fn(dogName) {
      this.dogsName.push(dogName);
    },
  },
};
</script>

<style>
ul {
  list-style: none;
}
</style>